#include <Arduino.h>
#include <SPI.h>
#include <Wire.h>
#include <U8g2lib.h>

U8G2_SSD1306_128X64_NONAME_F_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE, /* clock=*/ SCL, /* data=*/ SDA);   // ESP32 Thing, HW I2C with pin remapping

int LM35 = A0;
void setup()
{
    u8g2.begin();
    Serial.begin(9600);
    u8g2.setFont(u8g2_font_10x20_tr);
    u8g2.setCursor(0,20);
}

void loop()
{
    u8g2.clearBuffer();
    float temp = (5.0 * analogRead(LM35) * 100.0 / 1024);
    
    //Serial.println(temp);
    
    u8g2.setCursor(0,20);
    u8g2.print(temp);
    u8g2.sendBuffer();
    delay(1000);
}